package com.yequan.file.delete.concurrent;

import com.yequan.file.delete.FileUtil;

import java.nio.file.Path;

/**
 * @author yq
 * @date 2020/08/20
 */
public class PriorityDeleteTask implements Runnable {

    private Path path;

    public PriorityDeleteTask(Path path) {
        this.path = path;
    }

    @Override
    public void run() {
        boolean delete = FileUtil.deleteFile(path.toFile());
        if (delete) {
            System.out.println("已删除文件：" + path.getFileName());
        }
    }
}
